﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class Start_Manage : MonoBehaviour
{
    public Button play;
    public Button layout;
    public GameObject layoutSettingView;
    private void Awake()
    {
        Musices.AddInnerMusic();
        GameData.Read();
    }
    // Start is called before the first frame update
    void Start()
    {
        play.onClick.AddListener(()=> { SceneManager.LoadScene(1); });
        layout.onClick.AddListener(() => { layoutSettingView.SetActive(true); });
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            ExitGame();
        }
    }
    public void ExitGame()
    {
        GameData.Save();
        //预处理
#if UNITY_EDITOR    //在编辑器模式下
        EditorApplication.isPlaying = false;       
#else
        Application.Quit();
#endif
    }

}
